package com.qdxwx.models.enums;

/**
 * 提现状态
 */
public enum CashApplyStatus {

    REJECTED(-1, "被退回"),
    NOTAPPROVED(0, "待审核"),
    UNPAID(1, "未支付"),
    PAYMENT(2, "已支付");

    private final String name;
    private final int value;

    /**
     * @param name  名称
     * @param value 值
     */
    CashApplyStatus(int value, String name) {
        this.name = name;
        this.value = value;
    }

    public int getValue() {
        return this.value;
    }

    public String getName() {
        return this.name;
    }

    public static CashApplyStatus getStatus(int value) {
        for (CashApplyStatus status : CashApplyStatus.values()) {
            if (status.getValue() == value) {
                return status;
            }
        }
        return NOTAPPROVED;
    }

    @Override
    public String toString() {
        return "CashApplyStatus{" +
                "name='" + name + '\'' +
                ", value=" + value +
                '}';
    }
}
